<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="verify-v1" content="AJGp4G1LC8v3NaFgx0WIl/CoZD4hijMLXWUC2MQoPJU=" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>iStory - {{ title }}</title>
<link href="/stylesheets/favicon.ico" rel="icon" type="image/x-icon" />
<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/reset-fonts-grids/reset-fonts-grids.css&2.6.0/build/assets/skins/sam/skin.css">

<link rel="stylesheet" type="text/css" href="/stylesheets/main.css">
</head>
<body class="yui-skin-sam">


{% block top %}
<table class="layout_container">
<tr><td class="layout_header" colspan="2">
	<table class="tableHeader"><tr>
	<td><a href="/"><img src="/stylesheets/istory-icon.png"></a></td>
	<th><h1><a href="/">iStory</a></h1></th>
	<td>
		<a href="{{ loginURL }}">{{ login }}</a>
		{% if loggedIn %}
		{{ currentUser }}
		| <a href="{{ myStoriesURL }}">{{ myStories }}</a>
		{% endif %}
		| <a href="http://groups.google.com/group/istoryweb/web/istory-resources">Help</a>
	</td></tr></table>
</td></tr>
{% endblock %}


<tr><td class="layout_sidebar">

{% block sidebar %}
		<h3>What is iStory?</h3>
		<div class="sb1">
		<div>iStory is an interactive story telling environment for the iPhone.
			<br><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=303634203&mt=8">Buy iStory from the App Store</a></div>
		<div>Login with your Google account and use the <b><i>StoryForge</i></b> to create your own dynamic story line, complete with text, pictures, and choices.</div>
		<div>While writing your story, you'll be able to experience it on your own iPhone.</div>
		<div>When you're done, simply submit your story to share it with the rest of the world!</div>
		<div>Tell your friends and family and let them craft a path through your story, or try it out for yourself. You'll love being able to choose your own adventure each and every time you play through.</div>
		<div>The best part about iStory is that you can make <i>whatever</i> you want. Short, long, full of pictures, or hundreds of story branches- if you can think it, you can make it.</div>
		<div><script type="text/javascript"><!--
		google_ad_client = "pub-8635596764254051";
		/* 234x60, created 2/3/09 graphite */
		google_ad_slot = "1443998776";
		google_ad_width = 234;
		google_ad_height = 60;
		//-->
		</script>
		<script type="text/javascript"
		src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script></div>
		</div>
{% endblock %}

</td>

{% block middle %}
{% endblock %}

<td class="layout_mainContent">

{% block main %}
	<div id="books" class="books">
		<div class="book3"><h1>Featured Stories</h1></div>
	{% for rating in ratings %}
		<span class="book"><div>
			<center>
				<b><a href="/play/{{ rating.adventureStatus.publishedAdventure.key }}/{{ rating.adventureStatus.publishedAdventure.title|escape }}">{{ rating.adventureStatus.publishedAdventure.title|escape }}</a></b><br>
				<i>{{ rating.adventureStatus.publishedAdventure.author|escape }}</i><br>
				{{ rating.adventureStatus.publishedAdventure.created.date }}<hr>
				{% if rating.adventureStatus.publishedAdventure.coverImage %}<img src="/images/{{ rating.adventureStatus.publishedAdventure.coverImage }}.png"><hr>
				{% else %}<img src="/stylesheets/bookCover{{ coverImages|random }}.png"><hr>
				{% endif %}
			</center>
			<code>{{ rating.adventureStatus.publishedAdventure.desc|escape }}</code><hr>
			<table class="ratings" id="{{ rating.rating }}"></table>
			<span style="margin-right:20px;">Plays: {{ rating.plays }}</span><span style="margin-left:20px;">Votes: {{ rating.voteCount }}</span>
		</div></span>
	{% endfor %}
	</div>
{% endblock %}

</td></tr>

<tr><td class="layout_footer" colspan="2">

{% block bottom %}
		<table width="100%">
		<tr>
			<td>Powered by <a href="http://code.google.com/appengine/">Google App Engine</a></td>
			<td>iStory source code is available from <a href="http://code.google.com/p/istory-web">Google code</a></td>
		</tr>
		<tr>
			<td>Find a bug? Have a question or suggestion? Go <a href="http://groups.google.com/group/istoryweb">Here</a></td>
			<td>iStory and iStoryWeb &copy; 2008-2009 Taylor Steil</td>
		</tr></table>
{% endblock %}

</td></tr></table>

{% block footer %}
{% endblock %}

{% block index %}
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript">
//Add an onDOMReady handler to build the tree when the document is ready
YAHOO.util.Event.onDOMReady(treeInit);
//set shortcuts for common yahoo stuff
var YUD = YAHOO.util.Dom, YUE = YAHOO.util.Event, YUC = YAHOO.util.Connect;

//if there is no console, set it to null
try { console.log('init console... done'); } catch(e) { console = { log: function() {} } }

function treeInit() {
	var ratings = YUD.getElementsByClassName('ratings', 'table', 'books');
	for (var i = 0; i < ratings.length; i++) {
		rating = parseFloat(ratings[i].id);
		console.log(ratings[i]);
		console.log(rating);
		var myHTML = '<tr><td>Rating:';
		var totalStars = 0;
		while (rating >= 1) {
			myHTML += '<td class="star"><span class="icon-starFull" /></td>';
			totalStars++;
			rating--;
		}
		if (rating > 0) {
			myHTML += '<td class="star"><span class="icon-starHalf" /></td>';
			totalStars++;
		}
		while (totalStars < 5) {
			myHTML += '<td class="star"><span class="icon-starEmpty" /></td>';
			totalStars++;
		}
		myHTML += '</tr>';
		ratings[i].innerHTML = myHTML;
	}
}
</script>
{% endblock %}

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4537057-5");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>